﻿using AutoMapper;
using B.S.Orders.Domain;
using B.S.Orders.Write.Api.Application.Command.DispatchProductCommand;
using B.S.Orders.Write.Api.Application.Command.DocumentsCommand;
using B.S.Orders.Write.Api.Application.Command.OrdersCommands;
using B.S.Orders.Write.Api.Application.Command.OutsourcingCommand;
using B.S.Orders.Write.Api.Application.Command.ProcessCommand;
using B.S.Orders.Write.Api.Application.Command.ProjectCommand;
using B.S.Orders.Write.Api.Application.Command.ProjectTypeCommand;
using System.Diagnostics;
using Process = B.S.Orders.Domain.Process;

namespace B.S.Orders.Write.Api
{
    public class MapperProfile:Profile
    {
        public MapperProfile()
        {
            CreateMap<CreateOrdersCommand, OrdersModel>().ReverseMap();//生产明细
            CreateMap<UpdOrdersCommand, OrdersModel>().ReverseMap();
            CreateMap<CreateDocumentsCommand, Documents>().ReverseMap();//生产信息
            CreateMap<UpdDocumentsCommand, Documents>().ReverseMap();
            CreateMap<CreateProjectCommand, ProjectModel>().ReverseMap();//项目信息
            CreateMap<UpdProjectCommand, ProjectModel>().ReverseMap();
            CreateMap<CreateProjectTypeCommand, ProjectType>().ReverseMap();//项目名称
            CreateMap<UpdProjectTypeCommand, ProjectType>().ReverseMap();
            #region 生产派工
            CreateMap<AddDispatchProductCommand, DispatchProduct>().ReverseMap();
            CreateMap<AddDispatchDetailsCommand, DispatchDetails>().ReverseMap();
            CreateMap<DispatchProduct, UpdateDispatchProductCommand>().ReverseMap();
            CreateMap<DispatchDetails, UpdateDispatchDetailsCommand>().ReverseMap();
            #endregion
            #region 生产委外
            CreateMap<Outsourcing, AddOutsourcingCommand>().ReverseMap();
            CreateMap<OutsourcingDeetail, AddOutsourcingDetailCommand>().ReverseMap();
            CreateMap<Outsourcing, UpdateOutsourcingCommand>().ReverseMap();
            CreateMap<OutsourcingDeetail, UpdateOutsourcingDetailCommand>().ReverseMap();
            #endregion
            #region 生产工序
            CreateMap<Process, AddProcessCommand>().ReverseMap();
            CreateMap<Equipment, AddEquipmentCommand>().ReverseMap();
            CreateMap<Personnel, AddPersonnelCommand>().ReverseMap();
            CreateMap<Process, UpdateProcessCommand>().ReverseMap();
            CreateMap<Equipment, UpdatedEquipmentCommand>().ReverseMap();
            CreateMap<Personnel, UpdatedPersonnelCommand>().ReverseMap();
            #endregion
        }
    }
}
